
class ReactReduxUtils {



   static createReducer(initialState){
        return (state=initialState,action)=>{
            switch (action.type) {
                case 'SET_STATE':
                    return Object.assign({}, state, action.state)   //对象拷贝并作部分修改
                default:
                    return state
            }
        }
    }

    static action(dispatch){
        return {
            setState(state){
                dispatch({
                    type: "SET_STATE",
                    state: state,
                });
            }
        }
    }


}

export default ReactReduxUtils;